package de.g18.llmaa.gui.workspace.internalFrame.product;

import java.util.ArrayList;
import java.util.Date;

import javax.swing.event.TableModelListener;
import javax.swing.table.TableModel;

import de.g18.llmaa.logic.vos.VOKey;

public class TableModel_Keys implements TableModel {

	private ArrayList<VOKey> list_Keys;

	public TableModel_Keys( ArrayList<VOKey> list_Keys) {
		this.list_Keys = list_Keys;
	}

	@Override
	public void addTableModelListener(TableModelListener arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public Class<?> getColumnClass(int columNr) {
		switch (columNr) {
		case 0:

			return Integer.class;
		case 1:

			return Date.class;
			
		case 2:

			return String.class;
			

		default:
			break;
		}
		return null;
	}

	@Override
	public int getColumnCount() {
		// TODO Auto-generated method stub
		return 3;
	}

	@Override
	public String getColumnName(int columNr) {
		switch (columNr) {
		case 0:

			return "ID";
		case 1:

			return "Datum";
			
		case 2:

			return "Serial";
			

		default:
			return "";
		}
		
	}

	@Override
	public int getRowCount() {
		// TODO Auto-generated method stub
		return list_Keys.size();
	}

	@Override
	public Object getValueAt(int arg0, int arg1) {
		
		VOKey key = list_Keys.get(arg0);
		
		switch (arg1) {
		case 0:
			
			return key.getKey_Id();
		case 1:
			
			return key.getKey_ClaimedDate();
		case 2:
			
			return key.getKey_Serial();

		default:
			break;
		}
		return null;
	}

	@Override
	public boolean isCellEditable(int arg0, int arg1) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void removeTableModelListener(TableModelListener arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void setValueAt(Object arg0, int arg1, int arg2) {
		// TODO Auto-generated method stub

	}

}
